package leetcode100;

import java.util.Scanner;

/**
 * @author shkstart
 * @create 2023-02-03-21:36
 */
public class Meme34_1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int count = scanner.nextInt();
//            String strs[] = new String[count];
//            for (int i = 0; i < count; i++) {
//                strs[i] = scanner.next();
//            }
                scanner.nextLine();
            for (int i = 0; i < count; i++) {
                String strs = scanner.nextLine();
//                if(i<count-1){
//                    if(strs[i].contains(",")||strs[i].contains(" ")){
//                        System.out.print("\""+strs[i]+"\""+", ");
//                    }else{
//                        System.out.print(strs[i]+", ");
//                    }
//                }else {
//                    if(strs[i].contains(",")||strs[i].contains(" ")){
//                        System.out.print("\""+strs[i]+"\"");
//                    }else{
//                        System.out.print(strs[i]);
//                    }
//                }
                if(i<count-1){
                    if(strs.contains(",")||strs.contains(" ")){
                        System.out.print("\""+strs+"\""+", ");
                    }else{
                        System.out.print(strs+", ");
                    }
                }else {
                    if(strs.contains(",")||strs.contains(" ")){
                        System.out.print("\""+strs+"\"");
                    }else{
                        System.out.print(strs);
                    }
                }
            }
        }

    }
}
